import { Request, Router } from 'express'
import login from './login'
import user from './user'
import Back from '../app/common/Back'
import config from '../config'

const router = Router()

// 首页
router.get('/', (req, res) => {
  res.send('这把我们就遇到高手了')
})
// 登录路由
router.use('/login', login)
// 用户路由
router.use('/user', user)

// 必须放在最后！！！
router.all('*', (req, res, next) => {
  res.json(Back.fail('接口未定义', config.status.notFound,))
})

export default router

